I was trying to learn C++ last year but made a feeble attempt and decided to try and learn it and i will be taking classes on it in a couple semesters. but anyways, i would like it if someone could show me how to perform a basic operation, like adding 2 numbers.
here's what i have so far but it obviously isn't correct:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs [])
{int n1 = 1;
int n2 = 2;
cout << "int n1 + int n2" << endl;
system ("PAUSE") ;
return 0;
}
obviously when all this program returns is
"int n1 + int n2" press any key to continue...
i'm making some obvious elementary error, anyone willing to help thank you
here's what i have so far but it obviously isn't correct:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs [])
{int n1 = 1;
int n2 = 2;
cout << "int n1 + int n2" << endl;
system ("PAUSE") ;
return 0;
}
obviously when all this program returns is
"int n1 + int n2" press any key to continue...
i'm making some obvious elementary error, anyone willing to help thank you